<?php 
/**
 *   Joomdiet - administrator/components/views/food/tmpl/default.php
 *   Author: Juan Dapena Paz (juan@bittingbits.com)
 *   Copyright (C) 2010 Bitting Bits S.L.
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
defined('_JEXEC') or die('Restricted access'); ?>
<form action="index.php" method="post" name="adminForm">
<?php
$ordering = ($this->lists['order'] == 'ordering');
?>
<div id="editcell">
    <table class="adminlist">
    <thead>
        <tr>
           <th width="10">
			<?php echo JText::_( 'Num' ); ?>
		  </th>
            <th width="5">
                <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" />
            </th>
      <th width="1"><?php echo JHTML::_( 'grid.sort', 'Id', 'id', $this->lists['order_Dir'], $this->lists['order']); ?></th>
             <th><?php echo JHTML::_( 'grid.sort', JText::_('COM_BBITSSD_TITLE'), 'title', $this->lists['order_Dir'], $this->lists['order']); ?></th>
              <th width="8%">
	<?php echo JHTML::_('grid.sort',   'Position', 'ordering', $this->lists['order_Dir'], $this->lists['order'] ); ?>
	<?php echo JHTML::_('grid.order',  $this->types ); ?>
</th>

        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="5"><?php echo $this->pagination->getListFooter(); ?></td>
        </tr>
    </tfoot>
    <tbody>
        <?php
        $k = 0;
       


        	$k = 0;
			for ($i=0, $n=count($this->items); $i < $n; $i++) {
        	$row = $this->items[$i];
    		
			$checked 	= JHTML::_('grid.checkedout',   $row, $i );
			$access 	= JHTML::_('grid.access',   $row, $i );
			$published 	= JHTML::_('grid.published', $row, $i );
            $checked = JHTML::_('grid.id', $i, $row->id); 

             ?>
            <tr class="<?php echo 'row'.$k; ?>">
            
            	<td>
						<?php echo $this->pagination->getRowOffset( $i ); ?>
					</td>
            
                <td>
                    <?php echo $checked; ?>
                </td>
                <td>
                	<?php echo $row->id; ?>
                </td>
                <td>
<a href="index.php?option=com_bbitsd&controller=types&task=editType&cid[]=<?php echo $row->id; ?>"><?php echo $row->title; ?></a>
                </td>


<td class="order">
    <span><?php echo $this->pagination->orderUpIcon( $i, true, 'orderup', 'Move Up',$ordering ); ?></span>
	<span><?php echo $this->pagination->orderDownIcon( $i,$n,true, 'orderdown', 'Move Down',$ordering ); ?></span>
	
	<?php $disabled = $ordering ?  '' : 'disabled="disabled"'; ?>
	<input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" <?php echo $disabled ?> class="text_area" style="text-align: center" />
</td>


            </tr>
        <?php $k = 1 - $k; } ?>
    </tbody>
    </table>
</div>
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
<input type="hidden" name="option" value="com_bbitsd" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="controller" value="types" />

<?php echo JHTML::_( 'form.token' ); ?>
</form>
